package cn.edu.cug.cs.gtl.renders.openinventor.basics;


import cn.edu.cug.cs.gtl.apis.render.basics.Matrix;
import com.openinventor.inventor.SbMatrix;

public class MatrixImpl implements Matrix {
    private SbMatrix nativeObject = null;
    public MatrixImpl(){
        this.nativeObject = new SbMatrix();
    }

    public MatrixImpl(SbMatrix v){
        this.nativeObject = v;
    }
    @Override
    public Object getNativeObject() {
        return nativeObject;
    }

    @Override
    public boolean attach(Object nativeObject) {
        if(nativeObject instanceof  SbMatrix){
            this.nativeObject = (SbMatrix) nativeObject;
            return true;
        }
        return false;
    }

    @Override
    public Object detach() {
        Object r = this.nativeObject;
        this.nativeObject=null;
        return r;
    }
}
